<?php

namespace Controller\Passport;

class Bind extends  \Controller\Base {

	public function actionIndex() {
		$this->setCurrentMenuKey('My');
		$fromUrl = $this->getParam('fromurl');
		$fromUrl = urldecode($fromUrl);
		$fromUrl = $fromUrl ? $fromUrl : '/';
		$mask = $this->getUserMask();
		$authInfo = \Business\User::instance()->getOAuthInfoByMask($mask);
		if (!$authInfo) {
			\Lib\Util\Comm::redirect('/register.html?fromurl=' . urlencode($fromUrl));
		}

		$this->assign('authInfo', $authInfo);
		$this->assign('fromUrl', $fromUrl);
		$this->display();
	}
}